package com.hangzhou.xyj.net.request;

import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.hangzhou.xyj.net.request.base.BaseRequest;
import com.hangzhou.xyj.utils.constants.API;

/**
 * Created by yaohuix on 2016/3/21  18:14
 * <p/>
 * 获取动态详情
 */
public class GetDynamicDetailReq extends BaseRequest {

    public GetDynamicDetailReq(int id) {
        this(id + "");
    }

    public GetDynamicDetailReq(String id) {
        JsonObject jsonObject = new JsonObject();
        jsonObject.addProperty("id", id);
        String jsonStr = new Gson().toJson(jsonObject);
        add("data", jsonStr);
    }

    /**
     * @param
     * @return
     * @author yaohuix
     * @date 2016/3/21 18:15
     */
    public GetDynamicDetailReq(int id, int userId) {
        JsonObject jsonObject = new JsonObject();
        jsonObject.addProperty("id", id);
        jsonObject.addProperty("userId", userId);
        String jsonStr = new Gson().toJson(jsonObject);
        add("data", jsonStr);
    }

    @Override
    public String getUrl() {
        return API.DYNAMIC_DETIAL; 
    }
}
